import javax.microedition.io.Connection;
import javax.microedition.io.Connector;
import javax.wireless.messaging.MessageConnection;
import javax.wireless.messaging.TextMessage;

public final class ak
    implements k, y
{

    private k a;
    private bs b;
    private aj c;
    private bq d;
    private p e;

    public ak()
    {
    }

    public final void a(bq bq1, p p1)
    {
        if(bq1.k instanceof Object[])
        {
            Object aobj[] = (Object[])(Object[])bq1.k;
            a = (k)aobj[0];
            b = (bs)aobj[1];
            c = (aj)aobj[2];
            bq1.k = null;
            d = bq1;
            e = p1;
            return;
        }
        q q1;
        String s = (q1 = bq1.i).b("number").toString();
        String s1 = q1.b("message").toString();
        p1.c = q.e;
        try
        {
            MessageConnection messageconnection;
            TextMessage textmessage;
            (textmessage = (TextMessage)(messageconnection = (MessageConnection)Connector.open("sms://" + s)).newMessage("text")).setPayloadText(s1);
            messageconnection.send(textmessage);
            messageconnection.close();
            p1.c = q.f;
            return;
        }
        catch(Throwable throwable)
        {
            ce.c("Message sending failed: " + throwable);
        }
    }

    public final cd a(ba ba1)
    {
        return a.a(ba1);
    }

    public final az b(ba ba1, int j)
    {
        return a.b(ba1, j);
    }

    public final boolean a(int j, int l)
    {
        return a.a(j, l);
    }

    public final void a(ba ba1, int j)
    {
        if(j == 11)
        {
            bh.b().b(c, true);
            ce.a(b, false);
            return;
        }
        if(j == 10)
        {
            bh.b().b(c, true);
            try
            {
                a(d, e);
                ce.a(b, e.c.d());
            }
            catch(Exception _ex) { }
        }
    }

    public final boolean a(Object obj)
    {
        return a.a(obj);
    }
}